package com.lucy.flow.domain.entity;

import com.lucy.common.converter.EncryptConverter;
import com.lucy.common.core.BaseEntity;
import com.lucy.flow.converter.FlowModelConverter;
import com.lucy.flow.model.FlowModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;

@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Entity
@Table(name = "flow_define")
@ApiModel(value = "流程定义",description = "")
public class FlowDefine extends BaseEntity implements Serializable {
    @ApiModelProperty("流程定义编码")
    @Column(name = "flow_define_code")
    String flowDefineCode;

    @ApiModelProperty("流程名称")
    @Column(name = "flow_name")
    String flowName;

    @ApiModelProperty("流程描述")
    @Column(name = "description",length = 512)
    String description;

    @Convert(converter = FlowModelConverter.class)
    @ApiModelProperty(value = "流程模型",notes = "JSON字符串")
    @Column(name = "flow_model",length = 10240)
    FlowModel flowModel;

    @ApiModelProperty(value = "流程状态",notes = "1 正常 0 被删除")
    @Column(name = "status")
    Integer status;
}
